import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "dbshopST016_后台删除前台侧边设置"
# 1.点击“删除”按钮，确定删除，删除成功。
firefox = openBrowser(urlAdmin)
# 登录后台
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox, "商品管理", "管理分类", "前台侧边设置")
firefox.find_element_by_link_text("删除").click()
firefox.switch_to.alert.accept()  # 点击确定按钮
# 断言
lis = firefox.find_elements_by_xpath("//tbody/tr/td[1]")
try:
    for i in lis:
        if "网站很好看" not in i.text:
            writeLog("%s 测试通过" % testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()
